package com.example.practical_training_projects.service;

import com.example.practical_training_projects.entity.test;
import com.example.practical_training_projects.entity.user;
import com.example.practical_training_projects.mapper.testMapper;
import com.example.practical_training_projects.vo.votestclass;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class testServicelmpl implements testService {
    @Autowired
    private testMapper mapper;

    @Override
    public List<test> getAlltest() {
        return mapper.getAlltest();
    }

    @Override
    public PageInfo<votestclass> findtestpage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<votestclass> lists=mapper.findAlltestAndclass();
        PageInfo<votestclass> pageInfo=new PageInfo<>(lists);
        return pageInfo;
    }

    @Override
    public Integer deleteTest(Integer t_uid) {
        return mapper.deleteTest(t_uid);
    }

    @Override
    public Integer insertTest(test t_uid) {
        return mapper.insertTest(t_uid);
    }

    @Override
    public test findTestuid(Integer t_uid) {
        return mapper.findTestuid(t_uid);
    }

    @Override
    public Integer updateTest(test test1) {
        return mapper.updateTest(test1);
    }

    @Override
    public List<test> getContest(String t_context) {
        return mapper.getContest(t_context);
    }

    @Override
    public List<test> getClass(String t_class) {
        return mapper.getClass(t_class);
    }

    @Override
    public List<votestclass> findAlltestAndclass() {
        return mapper.findAlltestAndclass();
    }

    @Override
    public List<votestclass> findtestBycontext(String t_context) {
        return mapper.findtestBycontext(t_context);
    }

    @Override
    public List<votestclass> findtestBycontextAndclassuid(Integer ts_uid, String t_context) {
        return mapper.findtestBycontextAndclassuid(ts_uid,t_context);
    }


}



